#define quickread
#ifdef quickread
#include <cstdio> 
template <typename T>
inline void read(T& x)
{
    int c=getchar(), f=1; x=0;
    while(c<'0'||'9'<c) {if(c=='-') f=-1; c=getchar();}
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    x*=f;
}
template <typename T>
inline void quickwrite(T x)
{
    if(x<0) putchar('-'), x*=-1;
    if(x>=10) quickwrite(x/10);
    putchar(x%10+'0');
}
#else 
#include <iostream>
#endif
#include <cmath>
#include <vector>
using namespace std;
using ull=unsigned long long;
#define DEBUG

/*
* 1.ans=0 u==v=2
* 2.ans<=6 
        1 ans
* 3.ans>6
        需要保证u,v互质
        偶数 ans/2 ans/2+1
        奇数 ans/2-1 ans/2+1
*/

const int N=1e9;
ull q;

void init()
{
    read(q);
}



void solve()
{
    init();
    while(q--)
    {
        ull ans; read(ans);
        if(ans==0) printf("2 2\n");
        else if(ans==1) printf("-1 -1\n");
        else if(ans<=6) printf("1 %lld\n", ans);
        else if(ans%2) printf("%lld %lld\n", ans/2, ans/2+1);
        else printf("%lld %lld\n", ans/2-1, ans/2+1);
    }
}

// #undef DEBUG
signed main()
{
    #ifdef DEBUG
        freopen("./in.txt", "r", stdin);
        freopen("./out.txt", "w", stdout);
    #endif
    #ifndef quickread
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #endif

    int T=1; //scanf("%d", &T);
    while(T--) 
    {
        solve();
    }
    return 0;
}
